/*
 *  $TEAM_NAME Space Trader
 */
package views;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;

/**
 * Pub Panel
 * @author twb
 * @version 1.0
 */
public class PubPanel extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * field
	 */
	private final JTable table;
	
	/**
	 * pub panel
	 */
	public PubPanel() {
		
		//tabbedPane.addTab("Market", null, panel_1, null);
		//setLayout(new MigLayout("", "[grow]", "[grow][]"));
		
		// This is only for testing the table layout
		final String[][] data = {{"Billy", "2", "3", "10", "1", "5000"}, 
				{"Stephen", "50", "3", "250", "34", "1000"}};
		
		final String[] colNames = {"Name", "Pilot", "Fighter", "Trader",
				"Engineer", "Cost"};
		
		//TODO implement getters for filling the tables
		
		table = new JTable(data, colNames);
		table.setFillsViewportHeight(true);
		table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		table.setShowGrid(true);
		table.setShowHorizontalLines(true);
		table.setShowVerticalLines(true);
		
		super.setLayout(new BorderLayout());
		super.add(table.getTableHeader(), BorderLayout.PAGE_START);
		super.add(table, BorderLayout.CENTER);
		
		final JPanel panel_5 = new JPanel();
		super.add(panel_5, BorderLayout.SOUTH);
		
		final JButton btnCurrentCrew = new JButton("Current Crew");
		panel_5.add(btnCurrentCrew);
		
		final JButton btnHire = new JButton("Hire");
		panel_5.add(btnHire);
		

	}
}
